/**
 * CopyRight © 2012 USTC SINOVATE SOFTWARE CO.LTD All Rights Reserved.
 */

package com.cmcc.zysoft.infocollection.mobile.service;

import java.util.List;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import com.cmcc.zysoft.infocollection.mobile.dao.MCitiesDao;
import com.cmcc.zysoft.infocollection.model.Cities;
import com.starit.common.dao.hibernate.HibernateBaseDao;
import com.starit.common.dao.service.BaseServiceImpl;

/**
 * @author 袁凤建
 * <br />邮箱: yuan.fengjian@ustcinfo.com
 * <br />描述: MCitiesService.java
 * <br />版本: 1.0.0
 * <br />日期: 2013-11-4 下午4:08:58
 * <br />CopyRight © 2012 USTC SINOVATE SOFTWARE CO.LTD All Rights Reserved.
 */

@Service
public class MCitiesService extends BaseServiceImpl<Cities, Integer> {

	@Resource
	private MCitiesDao mCitiesDao;
	
	@Override
	public HibernateBaseDao<Cities, Integer> getHibernateBaseDao() {
		return this.mCitiesDao;
	}
	
	/**
	 * 根据城市ID获取城市信息.
	 * @param cityId 城市ID
	 * @return Cities
	 */
	public Cities getCityById(String cityId) {
		List<Cities> list = this.mCitiesDao.getCities(cityId);
		if(null != list && !list.isEmpty()) {
			return list.get(0);
		} else {
			return null;
		}
	}
}